package tungsten.pb.module;
import com.google.protobuf.Message;
import tungsten.base.server.BaseClient;
import tungsten.pb.protocol.*;

public class BaseLoginModule extends Module
{
	public BaseLoginModule()
	{
		super(LoginProto.Req.getDefaultInstance().getParserForType());
	}

	@Override
	protected void onMessage(BaseClient client,Heads.Head head,Message absMsg)
	{
		LoginProto.Req message = (LoginProto.Req) absMsg;
		switch(message.getBodyCase())
		{
			case LOGIN:onLogin(client,head,message.getLogin());break;
			case BATTLE:onBattle(client,head,message.getBattle());break;
		}
	}

	protected void onLogin(BaseClient client,Heads.Head head,LoginProto.LoginReq login){}
	protected void onBattle(BaseClient client,Heads.Head head,LoginProto.BattleReq battle){}
}